package com.gxuwz.check.base;
import org.hibernate.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate4.HibernateTemplate;
public class BaseDao{
    @Autowired
    private HibernateTemplate hibernateTemplate;
    private Session session;

    public HibernateTemplate getHibernateTemplate() {
        return hibernateTemplate;
    }

    @Autowired
    private SessionFactory sessionFactory;

    public SessionFactory getSessionFactory() {
        return sessionFactory;
    }

    public Session getSession(){
        this.session = sessionFactory.openSession();
        return this.session;

    }
    public void SessionClose(){
        this.session.close();
    }
}
